package com.test.annotation;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.test.mapper.NodeMapper;
import com.test.po.Node;

public class App {

	public static void main(String[] args) {
        // 用我们的配置文件来启动一个 ApplicationContext
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("com.test.annotation.demo");
        System.out.println("context 启动成功");

        NodeMapper nodeMapper = context.getBean(NodeMapper.class);
        Node n1 = new Node();
        n1.setHostName("test5");
        n1.setPort("8005");
        int result = nodeMapper.save(n1);
        System.out.println(result);
    }

}
